<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="WorkPerDay.aspx.cs" Inherits="WorkPerDay" Title="Tackle - Work Per Day Report" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" Runat="Server">
    <strong>Work Per Day Report<br />
    </strong>
    <br />
    <table cellpadding="4" cellspacing="0" style="width: 98%">
        <tr>
            <td bgcolor="#e3eaeb" style="border-top: silver 1px ridge;
                border-left: silver 1px ridge; border-bottom: silver 1px ridge" valign="top" width="50%">
                <span style="font-size: x-small">Sprint: </span>
                <asp:DropDownList ID="ddSprintSelection" runat="server" AutoPostBack="True" DataSourceID="dsGetSprintNames"
                    DataTextField="SprintName" DataValueField="SprintID" Font-Size="X-Small" OnSelectedIndexChanged="ddSelectChange_SelectIndexChange" OnDataBound="ddSelectChange_DataBound" Font-Names="Verdana">
                </asp:DropDownList><span style="font-size: x-small"> </span>
                </td>
            <td bgcolor="#e3eaeb" style="border-right: silver 1px ridge; border-top: silver 1px ridge;
                border-bottom: silver 1px ridge; text-align: right;"
                valign="top">
                <span style="font-size: x-small">Owner:</span>
                <asp:DropDownList ID="ddOwner" runat="server" AutoPostBack="True" DataSourceID="dsTaskOwners"
                    DataTextField="Owner" DataValueField="PersonID" Font-Names="Verdana" Font-Size="X-Small" OnSelectedIndexChanged="ddSelectChange_SelectIndexChange" OnDataBound="ddSelectChange_DataBound">
                    <asp:ListItem Value="-1">All</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td colspan="2">
    <rsweb:ReportViewer ID="repViewWorkPerDay" runat="server" Font-Names="Verdana" Font-Size="8pt"
        Height="350px" Width="98%" OnPreRender="repViewWorkPerDay_PreRender">
        <LocalReport ReportPath="WorkPerDay.rdlc">
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="odsWorkPerDayReport" Name="DataSet1_WorkPerDayReport" />
                <rsweb:ReportDataSource DataSourceId="odsScrumTeamPrefs" Name="DataSet1_ScrumTeamPrefs" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
                <hr />
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <rsweb:ReportViewer ID="rptSprintTotals" runat="server" Font-Names="Verdana" Font-Size="8pt"
                    Height="450px" ShowToolBar="False" Width="825px">
                    <LocalReport ReportPath="PerPersonSprintWork.rdlc">
                        <DataSources>
                            <rsweb:ReportDataSource DataSourceId="odsPerPersonSprintTime" Name="DataSet1_PerPersonSprintTime" />
                        </DataSources>
                    </LocalReport>
                </rsweb:ReportViewer>
            </td>
        </tr>
    </table>
    <asp:ObjectDataSource ID="odsWorkPerDayReport" runat="server" SelectMethod="GetData"
        TypeName="DataSet1TableAdapters.WorkPerDayReportTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="ddOwner" Name="PersonName" PropertyName="SelectedValue" />
            <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:SqlDataSource ID="dsGetSprintNames" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        SelectCommand="SELECT tblSprint.SprintID, tblMasterBacklogSchedule.SprintName, tblMasterBacklogSchedule.MasterBacklogScheduleID FROM tblMasterBacklogSchedule INNER JOIN tblSprint ON tblMasterBacklogSchedule.MasterBacklogScheduleID = tblSprint.fMasterBacklogScheduleID WHERE (tblMasterBacklogSchedule.fScrumTeamID = @ScrumTeamID) ORDER BY tblMasterBacklogSchedule.EndDate DESC" ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="dsTaskOwners" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
        SelectCommand="SELECT DISTINCT tblSprintResources.Person AS Owner, Person as PersonID FROM tblSprintBacklog INNER JOIN tblSprintResources ON tblSprintBacklog.TaskOwnerID = tblSprintResources.SprintResourcesID WHERE (tblSprintBacklog.fSprintID = @SprintID) UNION SELECT ' All' as Owner, '%' as PersonID ORDER BY Owner">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:ObjectDataSource ID="odsPerPersonSprintTime" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetData" TypeName="DataSet1TableAdapters.PerPersonSprintTimeTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:ControlParameter ControlID="ddOwner" Name="PersonID" PropertyName="SelectedValue" />
            <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsScrumTeamPrefs" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetData" TypeName="DataSet1TableAdapters.ScrumTeamPrefsTableAdapter">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

